package com.durian.finance.service.impl;

import com.durian.common.core.utils.DateUtils;
import com.durian.finance.mapper.JrFactoringDetailMapper;
import com.durian.finance.service.IJrFactoringDetailService;
import com.durian.financial.api.domain.JrFactoringDetail;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 保理申请明细Service业务层处理
 * 
 * @author durian
 * @date 2022-06-27
 */
@Service
public class JrFactoringDetailServiceImpl implements IJrFactoringDetailService 
{
    @Resource
    private JrFactoringDetailMapper jrFactoringDetailMapper;


    /**
     * 查询保理申请明细
     * 
     * @param id 保理申请明细主键
     * @return 保理申请明细
     */
    @Override
    public JrFactoringDetail selectJrFactoringDetailById(Long id)
    {
        return jrFactoringDetailMapper.selectJrFactoringDetailById(id);
    }

    /**
     * 查询保理申请明细列表
     * 
     * @param jrFactoringDetail 保理申请明细
     * @return 保理申请明细
     */
    @Override
    public List<JrFactoringDetail> selectJrFactoringDetailList(JrFactoringDetail jrFactoringDetail)
    {
        return jrFactoringDetailMapper.selectJrFactoringDetailList(jrFactoringDetail);
    }

    /**
     * 新增保理申请明细
     * 
     * @param jrFactoringDetail 保理申请明细
     * @return 结果
     */
    @Override
    public int insertJrFactoringDetail(JrFactoringDetail jrFactoringDetail)
    {
        jrFactoringDetail.setCreateTime(DateUtils.getNowDate());
        return jrFactoringDetailMapper.insertJrFactoringDetail(jrFactoringDetail);
    }

    /**
     * 修改保理申请明细
     * 
     * @param jrFactoringDetail 保理申请明细
     * @return 结果
     */
    @Override
    public int updateJrFactoringDetail(JrFactoringDetail jrFactoringDetail)
    {
        jrFactoringDetail.setUpdateTime(DateUtils.getNowDate());
        return jrFactoringDetailMapper.updateJrFactoringDetail(jrFactoringDetail);
    }

    /**
     * 批量删除保理申请明细
     * 
     * @param ids 需要删除的保理申请明细主键
     * @return 结果
     */
    @Override
    public int deleteJrFactoringDetailByIds(Long[] ids)
    {
        return jrFactoringDetailMapper.deleteJrFactoringDetailByIds(ids);
    }

    /**
     * 删除保理申请明细信息
     * 
     * @param id 保理申请明细主键
     * @return 结果
     */
    @Override
    public int deleteJrFactoringDetailById(Long id)
    {
        return jrFactoringDetailMapper.deleteJrFactoringDetailById(id);
    }

}
